package com.aigis.big4.tmp.javase;

import java.io.IOException;
import java.util.Scanner;

public class StepCount {
    public static void main(String[] args){
        String S;
        System.out.println("输入长度");
        Scanner scanner=new Scanner(System.in);
        int L=scanner.nextInt();
        char[] chars=new char[L];
        System.out.println("输入字符，u、l、d、r");
        for (int i=0;i<L;i++){
            try{
                char c=(char) System.in.read();
                if (c=='u'||c=='d'||c=='l'||c=='r'){
                     chars[i]=c;
                }
            }catch(IOException e){
              e.printStackTrace();
            }
        }
        S=new String(chars);
        System.out.println("输出字符串："+S);
        System.out.println("Q次询问");
        int Q=scanner.nextInt();
    }
}
